Integrand size = 41, antiderivative size = 121 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx=-\frac {4 (A+2 i B) c^3 x}{a}-\frac {4 (i A-2 B) c^3 \log (\cos (e+f x))}{a f}-\frac {4 (A+i B) c^3}{a f (i-\tan (e+f x))}+\frac {(A+4 i B) c^3 \tan (e+f x)}{a f}+\frac {B c^3 \tan ^2(e+f x)}{2 a f} \]
[Out]
Time = 0.21 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78} \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx=\frac {c^3 (A+4 i B) \tan (e+f x)}{a f}-\frac {4 c^3 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac {4 c^3 (-2 B+i A) \log (\cos (e+f x))}{a f}-\frac {4 c^3 x (A+2 i B)}{a}+\frac {B c^3 \tan ^2(e+f x)}{2 a f} \]
[In]
[Out]
Rule 78
Rule 3669
Rubi steps \begin{align*} \text {integral}& = \frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^2}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {(a c) \text {Subst}\left (\int \left (\frac {(A+4 i B) c^2}{a^2}+\frac {B c^2 x}{a^2}-\frac {4 (A+i B) c^2}{a^2 (-i+x)^2}+\frac {4 i (A+2 i B) c^2}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {4 (A+2 i B) c^3 x}{a}-\frac {4 (i A-2 B) c^3 \log (\cos (e+f x))}{a f}-\frac {4 (A+i B) c^3}{a f (i-\tan (e+f x))}+\frac {(A+4 i B) c^3 \tan (e+f x)}{a f}+\frac {B c^3 \tan ^2(e+f x)}{2 a f} \\ \end{align*}
Time = 5.11 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.02 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx=\frac {c^3 \left (14 A+27 i B+8 (A+2 i B) \log (i-\tan (e+f x))+(4 i A-11 B+8 i (A+2 i B) \log (i-\tan (e+f x))) \tan (e+f x)+(2 A+7 i B) \tan ^2(e+f x)+B \tan ^3(e+f x)\right )}{2 a f (-i+\tan (e+f x))} \]
[In]
[Out]
Time = 0.14 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.58
method | result | size |
derivativedivides | \(\frac {c^{3} A \tan \left (f x +e \right )}{f a}+\frac {4 i c^{3} \tan \left (f x +e \right ) B}{f a}+\frac {B \,c^{3} \tan \left (f x +e \right )^{2}}{2 a f}+\frac {4 i c^{3} B}{f a \left (-i+\tan \left (f x +e \right )\right )}+\frac {4 c^{3} A}{f a \left (-i+\tan \left (f x +e \right )\right )}-\frac {4 c^{3} A \arctan \left (\tan \left (f x +e \right )\right )}{f a}+\frac {2 i c^{3} A \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f a}-\frac {8 i c^{3} B \arctan \left (\tan \left (f x +e \right )\right )}{f a}-\frac {4 c^{3} B \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f a}\) | \(191\) |
default | \(\frac {c^{3} A \tan \left (f x +e \right )}{f a}+\frac {4 i c^{3} \tan \left (f x +e \right ) B}{f a}+\frac {B \,c^{3} \tan \left (f x +e \right )^{2}}{2 a f}+\frac {4 i c^{3} B}{f a \left (-i+\tan \left (f x +e \right )\right )}+\frac {4 c^{3} A}{f a \left (-i+\tan \left (f x +e \right )\right )}-\frac {4 c^{3} A \arctan \left (\tan \left (f x +e \right )\right )}{f a}+\frac {2 i c^{3} A \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f a}-\frac {8 i c^{3} B \arctan \left (\tan \left (f x +e \right )\right )}{f a}-\frac {4 c^{3} B \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f a}\) | \(191\) |
norman | \(\frac {\frac {\left (4 i c^{3} B +c^{3} A \right ) \tan \left (f x +e \right )^{3}}{a f}+\frac {\left (8 i c^{3} B +5 c^{3} A \right ) \tan \left (f x +e \right )}{a f}-\frac {4 \left (2 i c^{3} B +c^{3} A \right ) x}{a}-\frac {-8 i c^{3} A +9 c^{3} B}{2 a f}-\frac {4 \left (2 i c^{3} B +c^{3} A \right ) x \tan \left (f x +e \right )^{2}}{a}+\frac {c^{3} B \tan \left (f x +e \right )^{4}}{2 a f}}{1+\tan \left (f x +e \right )^{2}}-\frac {2 \left (-i c^{3} A +2 c^{3} B \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{a f}\) | \(192\) |
risch | \(-\frac {2 c^{3} {\mathrm e}^{-2 i \left (f x +e \right )} B}{a f}+\frac {2 i c^{3} {\mathrm e}^{-2 i \left (f x +e \right )} A}{a f}-\frac {16 i c^{3} B x}{a}-\frac {8 c^{3} A x}{a}-\frac {16 i c^{3} B e}{f a}-\frac {8 c^{3} A e}{f a}-\frac {2 c^{3} \left (-i A \,{\mathrm e}^{2 i \left (f x +e \right )}+3 B \,{\mathrm e}^{2 i \left (f x +e \right )}-i A +4 B \right )}{a f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}+\frac {8 c^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{f a}-\frac {4 i c^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{f a}\) | \(199\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 219 vs. \(2 (107) = 214\).
Time = 0.27 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.81 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx=-\frac {2 \, {\left (4 \, {\left (A + 2 i \, B\right )} c^{3} f x e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-i \, A + B\right )} c^{3} + 2 \, {\left (4 \, {\left (A + 2 i \, B\right )} c^{3} f x + {\left (-i \, A + 2 \, B\right )} c^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (4 \, {\left (A + 2 i \, B\right )} c^{3} f x + 3 \, {\left (-i \, A + 2 \, B\right )} c^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, {\left ({\left (i \, A - 2 \, B\right )} c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, {\left (i \, A - 2 \, B\right )} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (i \, A - 2 \, B\right )} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{a f e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}} \]
[In]
[Out]
Time = 0.45 (sec) , antiderivative size = 265, normalized size of antiderivative = 2.19 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx=\frac {2 i A c^{3} - 8 B c^{3} + \left (2 i A c^{3} e^{2 i e} - 6 B c^{3} e^{2 i e}\right ) e^{2 i f x}}{a f e^{4 i e} e^{4 i f x} + 2 a f e^{2 i e} e^{2 i f x} + a f} + \begin {cases} \frac {\left (2 i A c^{3} - 2 B c^{3}\right ) e^{- 2 i e} e^{- 2 i f x}}{a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (- \frac {- 8 A c^{3} - 16 i B c^{3}}{a} + \frac {\left (- 8 A c^{3} e^{2 i e} + 4 A c^{3} - 16 i B c^{3} e^{2 i e} + 4 i B c^{3}\right ) e^{- 2 i e}}{a}\right ) & \text {otherwise} \end {cases} - \frac {4 i c^{3} \left (A + 2 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \frac {x \left (- 8 A c^{3} - 16 i B c^{3}\right )}{a} \]
[In]
[Out]
Exception generated. \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 307 vs. \(2 (107) = 214\).
Time = 0.60 (sec) , antiderivative size = 307, normalized size of antiderivative = 2.54 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx=\frac {2 \, {\left (\frac {2 \, {\left (-i \, A c^{3} + 2 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a} - \frac {4 \, {\left (-i \, A c^{3} + 2 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a} - \frac {2 \, {\left (i \, A c^{3} - 2 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a} - \frac {5 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 8 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2 i \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 7 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 10 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 14 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2 i \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 7 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 5 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 8 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - i \, \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{2} a}\right )}}{f} \]
[In]
[Out]
Time = 8.48 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.12 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-\frac {8\,B\,c^3}{a}+\frac {A\,c^3\,4{}\mathrm {i}}{a}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {c^3\,\left (A+B\,2{}\mathrm {i}\right )}{a}+\frac {B\,c^3\,2{}\mathrm {i}}{a}\right )}{f}+\frac {\frac {4\,B\,c^3}{a}+\frac {\left (4\,A\,c^3+B\,c^3\,8{}\mathrm {i}\right )\,1{}\mathrm {i}}{a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}+\frac {B\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,a\,f} \]
[In]
[Out]